VT-d: avoid allocating domid_{bit,}map[] when possible
authorJan Beulich <jbeulich@suse.com>
Tue, 4 Jan 2022 09:16:04 +0000 (10:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 Jan 2022 09:16:04 +0000 (10:16 +0100)
commit0ea20d36473511beb8dca0a071e1b7473291e5d3
tree1bb96816b37de81f0b872f4349659804722cd53a
parent4a59e6bb3a96f5ebca95d162b2a81b3e68b076a2
VT-d: avoid allocating domid_{bit,}map[] when possible

When an IOMMU implements the full 16 bits worth of DID in context
entries, there's no point going through a memory base translation table.
For IOMMUs not using Caching Mode we can simply use the domain IDs
verbatim, while for Caching Mode we need to avoid DID 0.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/iommu.h